import request from '/@/utils/request';

export function rolesApi() {
    return {
        // 表格列表
        getRolesList: (params: object) => {
            return request({
                url: '/api/admin/system/roles',
                method: 'get',
                params
            });
        },
        // 获取角色详情
        getRolesDetail: (params: object) => {
            return request({
                url: '/api/admin/system/role',
                method: 'get',
                params
            });
        },
        // 创建角色
        createRole: (data: object) => {
            return request({
                url: '/api/admin/system/role',
                method: 'post',
                data
            });
        },
        // 编辑角色
        updateRole: (data: object) => {
            return request({
                url: '/api/admin/system/role',
                method: 'put',
                data
            });
        },
        // 删除校色
        deleteRole: (data: object) => {
            return request({
                url: '/api/admin/system/role',
                method: 'delete',
                data
            });
        },

    }
}